from django.http import HttpResponse
from django.utils import simplejson

from tagging.models import Tag

def tag_list_json(request):
    tags = [tag.name for tag in Tag.objects.all()]
    json = simplejson.dumps({ 'success': True, 'tags': tags })
    return HttpResponse(json, mimetype='application/json')




def tag_list_plain(request):
    tags = [tag.name for tag in Tag.objects.all()]
    return HttpResponse('\n'.join(tags), mimetype='text/plain')